//
//  ActiTableViewCell.m
//  UI_元旦豆瓣半完整版
//
//  Created by dllo on 15/12/31.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "ActiTableViewCell.h"
#define WIDCH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height


@implementation ActiTableViewCell

- (void)dealloc {
    [_blueImage release];
    [_actiImage release];
    [_titleLable release];
    [_timeLable release];
    [_addressLable release];
    [_category_nameLable release];
    [_wisher_countLable release];
    [_participant_countLable release];
    [super dealloc];
    
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubviews];
    }
    return self;
}

- (void)creatSubviews {
    self.blueImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_blueImage];
    [_blueImage release];
    
    self.actiImage = [[UIImageView alloc] init];
    [self.contentView addSubview:_actiImage];
    [_actiImage release];
    
    self.titleLable = [[UILabel alloc] init];
    [self.contentView addSubview:_titleLable];
    [_titleLable release];
    
    self.timeLable = [[UILabel alloc] init];
    [self.contentView addSubview:_timeLable];
    [_timeLable release];
    
    self.addressLable = [[UILabel alloc] init];
    [self.contentView addSubview:_addressLable];
    [_addressLable release];
    
    self.category_nameLable = [[UILabel alloc] init];
    [self.contentView addSubview:_category_nameLable];
    [_category_nameLable release];
    
    self.wisher_countLable = [[UILabel alloc] init];
    [self.contentView addSubview:_wisher_countLable];
    [_wisher_countLable release];
    
    self.participant_countLable = [[UILabel alloc] init];
    [self.contentView addSubview:_participant_countLable];
    [_participant_countLable release];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    _blueImage.frame = CGRectMake(10, 10, WIDCH - 20, HEIGHT - 30);
    _blueImage.image = [UIImage imageNamed:@"bg_eventlistcell@2x.png"];

    UIImageView *whiteImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg_share_large.png"]];
    whiteImage.frame = CGRectMake(5, 50, WIDCH - 30, HEIGHT - 90);
    [_blueImage addSubview:whiteImage];
    [whiteImage release];
    
    _actiImage.frame = CGRectMake(WIDCH / 3 * 2, 65, 100, HEIGHT - 105);
    _actiImage.backgroundColor = [UIColor clearColor];
    
    
    _titleLable.frame = CGRectMake(20, 20, WIDCH - 40, 30);
    _titleLable.backgroundColor = [UIColor clearColor];
    _timeLable.font = [UIFont boldSystemFontOfSize:25];
    
    _timeLable.frame = CGRectMake(45, 62, WIDCH - 180, 30);
    _timeLable.backgroundColor = [UIColor clearColor];
    _timeLable.font = [UIFont systemFontOfSize:15];
    
    UIImageView *timeImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_date.png"]];
    timeImage.frame = CGRectMake(5, 5, 25, 25);
    [whiteImage addSubview:timeImage];
    [timeImage release];
    
    _addressLable.frame = CGRectMake(45, 100, WIDCH - 180, 30);
    _addressLable.backgroundColor = [UIColor clearColor];
    
    UIImageView *addImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_spot.png"]];
    addImage.frame = CGRectMake(5, 45, 25, 25);
    [whiteImage addSubview:addImage];
    [addImage release];
    
    _category_nameLable.frame = CGRectMake(90, 140, 50, 30);
    _category_nameLable.backgroundColor = [UIColor clearColor];
    
    UIImageView *cateImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_catalog.png"]];
    cateImage.frame = CGRectMake(5, 85, 25, 25);
    [whiteImage addSubview:cateImage];
    [cateImage release];
    
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(30, 80, 45, 30)];
    lable.text = @"类型: ";
    lable.backgroundColor = [UIColor clearColor];
    [whiteImage addSubview:lable];
    [lable release];
    
    UILabel *ganLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 120, 60, 30)];
    ganLabel.font = [UIFont systemFontOfSize:15];
    ganLabel.text = @"感兴趣: ";
    [whiteImage addSubview:ganLabel];
    [ganLabel release];
    
    UILabel *canLable = [[UILabel alloc] initWithFrame:CGRectMake(130, 120, 50, 30)];
    canLable.font = [UIFont systemFontOfSize:15];
    canLable.text = @"参加:";
    [whiteImage addSubview:canLable];
    [canLable release];
    
    
    _wisher_countLable.frame = CGRectMake(90, 180, 50, 30);
    _wisher_countLable.backgroundColor = [UIColor clearColor];
    _wisher_countLable.textColor = [UIColor redColor];
    
    _participant_countLable.frame = CGRectMake(185, 180, 50, 30);
    _participant_countLable.backgroundColor = [UIColor clearColor];
    _participant_countLable.textColor = [UIColor redColor];
    
    
    
    
    
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
